package job.work.domain.system.entity.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@Data
@Entity //代表当前是实体类
@ApiModel("角色类")//标记当前实体类
@Proxy(lazy = false)//禁止懒加载
@Table(name = "dec_role")
public class DecRole implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空")
    @ApiModelProperty(value = "角色名称",required = true)
    private String name;

    /**
     *角色状态 0 开启 1 禁用
     */
    @ApiModelProperty(value = "角色状态 0 开启 1 禁用")
    private Integer status;

    /**
     * 角色描述
     */
    private String description;

    /**
     * 菜单集合
     */
    @ApiModelProperty(value = "菜单ID集合",required = true)
    @Transient
    @NotNull(message = "角色权限不能为NULL")
    List<Long> children;

}
